<%@ page pageEncoding="utf-8"%>
<%@ taglib prefix="aa" uri="http://ajaxanywhere.sourceforge.net/" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<title><fmt:message key="cityForm.title"/></title>
<script src="<c:url value='/scripts/common.js'/>"></script>
<script src="<c:url value='/scripts/ajax/aa.js'/>"></script>


<script> 
	function aaa(){ 
	//ajaxAnywhere = new AjaxAnywhere(); 
	//ajaxAnywhere.id = "kellen";
	 
	//ajaxAnywhere.formName = "cityForm";  
	ajaxAnywhere.getZonesToReload = function() {

    return "kellen";

	}
//	ajaxAnywhere.onGetAjaxNotSupported('./city.html')
	ajaxAnywhere.submitAJAX(); 
	//  ajaxAnywhere.dropPreviousRequest();

	
	}
</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<%--<link rel="stylesheet" type="text/css" media="all"	href="/sasis/styles/css.css" />--%>
<link rel="stylesheet" type="text/css" media="all"	href="/sasis/styles/displaytag.css" />
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
</head>

<body>
<html:form action="city.html?method=search&flag=do"><%--?method=search&flag=do--%>
<table width="99%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr> 
     <td class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle"/>城市信息维护查询</td>
</tr>

  <tr> 
    <td height="25" class="home-table-tool-content02">
     <input type="button" 
                class="home-table-inputbox"
        		onclick="location.href='<c:url value="/city.html?method=edit"/>'"
        		
        		value="<fmt:message key="button.add"/>"
	   	<p:notAllow pid="6371"> 
      		disabled
      	 </p:notAllow>
        		/>
    <input type="button" class="home-table-inputbox"
        		onclick="doDelete('selected_id')"
        		value="<fmt:message key="button.delete"/>" 
		<p:notAllow pid="6373"> 
      		disabled
      	 </p:notAllow>
        		/>	 
	<html:reset styleClass="home-inputBtn" property="method.reset"> 重置 </html:reset>        		
    </td>
  </tr>
  
  <tr>
	<td height="30" class="home-search-space">
     代码:&nbsp;<html:text property="code" styleId="code" styleClass="home-table-inputbox" size="12"/>&nbsp;&nbsp;&nbsp;&nbsp;
	名称:&nbsp;<html:text property="name" styleId="name" styleClass="home-table-inputbox" size="12"/> &nbsp;&nbsp;&nbsp;&nbsp;
		<input name="Submit2" type="button" class="home-inputBtn" value="查询" onClick="javascript:Search();"/>	
	     
	</td>
   </tr>  

<%--  <tr>
    <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

      <tr height=20>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;&nbsp;</td>
        <td align="left" class="font-search"><fmt:message key="cityForm.name"/>：</td>
        <td align="left">
        <html:text property="name" size="12"/></td>
        <td>&nbsp;&nbsp;</td>
        <td align="left" class="font-search"><fmt:message key="cityForm.status"/>：</td>
        <td align="left">
			<html:select property="status" size="1" >
				<html:option value="-1">&nbsp;</html:option>
        		<html:option value="1"><fmt:message key="cityForm.yes"/></html:option>
        		<html:option value="0"><fmt:message key="cityForm.no"/></html:option>
        	</html:select>
		</td>
        <td>&nbsp;&nbsp;</td>
        <td align="left">
		<input name="Submit2" type="submit" class="textarea"  value="查询" />&nbsp;</td>
      </tr>
      <tr height=20>
        <td align="left">&nbsp;</td>
      </tr>
     </table>
    </td>
  </tr>
 --%> 
<%--    
    <tr>
    <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="right" background="images/list_title_bg.jpg"><table width="100%" height="18" border="0" cellpadding="0" cellspacing="0">
              <tr>
                 <td  align="left" valign="bottom" class="black12">&nbsp;&nbsp;&nbsp;&nbsp;
                 <input name="Submit22" type="button" class="textarea" value="<fmt:message key='cityForm.add'/>" 
          			onclick="MM_openBrWindow('city.html?method=edit','','width=500,height=400')"/>
				 <input type="button" style="margin-right: 5px" 
                     	class="textarea"
        			onclick="doDelete('selected_id')"
        			value="<fmt:message key="button.delete"/>"/>          			
          		</td>
				<td>&nbsp; </td>
              </tr>
            </table></td>
            <td width="6" align="right" valign="top"><img src="images/list_title_right.jpg" width="6" height="30" /></td>
          </tr>
        </table></td>
     </tr>
 --%>       
 <%--      <tr>
        <td align="left" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="98%" align="left" valign="top" class="list_area_bg">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="1%" align="left" valign="top">&nbsp;</td>
                <td width="99%" align="left" valign="top">
  --%>              
                
                <%--table width="100%" border="1" cellpadding="0" cellspacing="0" class="list_bordercolor">
                    <tr>
                     <td class="list_title_bottom" width="10"><input type="checkbox" name="checkbox" value="checkbox" onclick='checkAll(this.checked,"checkbox2");' /></td>
                    <td   class="list_font_title"><fmt:message key="cityForm.code"/></td>
                      <td  class="list_font_title"><fmt:message key="cityForm.name"/></td>
                      <td   class="list_font_title"><fmt:message key="cityForm.status"/></td>
		      <td class="list_font_title" width="50">&nbsp;<fmt:message key="button.edit"/></td>		   				 
		      <td class="list_font_title"  width="50">&nbsp;<fmt:message key="button.view"/></td>
                    </tr>
                    
                    
                    <c:forEach var="results" items="${cityList}"  varStatus="status">
                    <tr>
                    
                    <td><span class="list_title_bottom">
                        <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" />
                      </span></td>
                    	<td class="list_font_area"><c:out value="${results.code}"/></td>
                      	<td class="list_font_area">&nbsp;<c:out value="${results.name}"/></td>
                      	<td class="list_font_area">
                      	<c:if test="${results.status eq 1}">
                     	是
                      </c:if>
                      <c:if test="${results.status ne 1}">
                      	否
                      </c:if>
                      </td>
		<p:allow pid="6372">                       
             <td class="list_font_area" width="50">
		    	<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="window.location='./city.html?method=edit&id=<c:out value="${results.id}"/>'">&nbsp;
		    </td>
		</p:allow>		    
		    <td class="list_font_area" width="50">
		    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="MM_openBrWindow('./city.html?method=view&id=<c:out value="${results.id}"/>','','width=500,height=400')">&nbsp;
		    </td>                    </tr>
                   </c:forEach>
                 </table--%>
                 
 
 <tr> 
    <td valign="top"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content02"><sasis:page items="${cityList}"/></td>
              </tr>
              <tr> 
                <td align="center" valign="top" class="home-edittable-space">	
		<%--table width="100%" border="0" cellpadding="2" cellspacing="0" class="list_bordercolor">
                   <tr> 
                      <td width="6%" class="home-list-title"><div align="center"> 
                          <input type="checkbox" name="checkbox" value="checkbox" onclick="chooseAll(this)" />
                        </div></td>
                       <td  width="25%" class="home-list-title">代码</td>
                      <td  width="35%" class="home-list-title">名称</td>
		              <td class="home-list-title" width="5%"><fmt:message key="button.edit"/></td>		   				 
		              
                 </tr>
                 
                  <c:forEach var="results" items="${cityList}" varStatus="status">
                    <tr>
                      <td class="home-list-content"><div align="center">
                        <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" />
                     </td>

                      <td class="home-list-content"><c:out value="${results.code}"/></td>
                      <td class="home-list-content"><c:out value="${results.name}"/></td>

   		 <p:allow pid="6372"> 
                      
		    <td class="home-list-content" width="50">
		    	<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="window.location='./city.html?method=edit&id=<c:out value="${results.id}"/>'"/>&nbsp;
		    </td>

      	 </p:allow>		    
		   
                    </tr>
		</c:forEach> 
                  
  </table--%>
  
   <display:table name="cityList" id="results" defaultsort="1" class="table" defaultorder=
   "descending" style="width:100%;TEXT-ALIGN: left"   export="true"  requestURI="city.html">
					<display:column  media="html" style="width:30px;" title="<input type='checkbox' name='selectall' onclick='chooseAll(this)'/>">
	
                     <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" />
                    </display:column>
    				<display:column  property="code" title="代码" style="width:100px;TEXT-ALIGN: left" sortable="true" />
    				<display:column  property="name" title="名称" style="width:550px;TEXT-ALIGN: left"  sortable="true"/> 
   		         <display:column  media="html"  style="width:50px;"  title="更新">
					<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="window.location='./city.html?method=edit&id=<c:out value="${results.id}"/>'"/>&nbsp;
				 </display:column>	
</display:table>
  				
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td height="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
</body>
<script>
//written by kellen 07-04-19
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i];  
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
				document.forms[0].method="post";
				document.forms[0].action="./city.html?method=delete";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
function Search(){
    //alert("come search");
    //将需要验证的ID传入数组
	var propertyArray = new Array();
	propertyArray.push("code");
	propertyArray.push("name");
	//alert(propertyArray.length)
	//把验证数组传入验证特殊字符函数
	var result=checkSpecialInput(propertyArray);
	//alert("result="+result);
	if(result==true||result==null){
	     //alert(result);
	    cityForm.action="./city.html?method=search&flag=do";
	    cityForm.submit();
	     
	}else{
	    alert(result);
	}
}


</script>
</html>


